From: Jonas Dreßler Date: Wed, 25 Apr 2018 21:56:29 +0000 (+0200) Subject: switcherPopup: Swap Math.max and Math.min in _scrollToLeft X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~772^2^2~29 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=548c41d16415cda72d85a1ca5872f6cbef91072b;p=gnome-shell.git switcherPopup: Swap Math.max and Math.min in _scrollToLeft Limit the minimum and maximum value to scroll to inside the box to 0 and the upper limit, for some reason this was done right in _scrollToRight, but not in _scrollToLeft. This fixes the behavior of scrolling to the left: Before, scrolling one item to the left moved the view to the first element of the list (this can make the selected element invisible in large lists). Instead, scroll one item to the left, just like scrolling to the right works. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/167 --- diff --git a/js/ui/switcherPopup.js b/js/ui/switcherPopup.js index 16aa24c64..2f88ce5fe 100644 --- a/js/ui/switcherPopup.js +++ b/js/ui/switcherPopup.js @@ -480,9 +480,9 @@ var SwitcherList = GObject.registerClass({ let item = this._items[index]; if (item.allocation.x1 < value) - value = Math.min(0, item.allocation.x1); + value = Math.max(0, item.allocation.x1); else if (item.allocation.x2 > value + pageSize) - value = Math.max(upper, item.allocation.x2 - pageSize); + value = Math.min(upper, item.allocation.x2 - pageSize); this._scrollableRight = true; adjustment.ease(value, {